import request from "./config";

// 获取文章评论
export const getArticleComments = (articleId) => {
  return request({
    url: `/comments/${articleId}`,
    method: "get",
  });
};

// 写评论
export const writeComment = (data) => {
  return request({
    url: "/api/comments",
    method: "post",
    data,
  });
};

// 删除评论
export const deleteComment = (id) => {
  return request({
    url: `/api/comments/${id}`,
    method: "delete",
  });
};

// 评论列表
export const getCommentList = (params) => {
  return request({
    url: "/api/comments/list",
    method: "get",
    params,
  });
};
